﻿using System.IO;
using Newtonsoft.Json;
namespace AppFuscator
{
    public class AssemblyItem
    {
        public string FileName { get; set; }

        [JsonIgnore]
        public string Title { get { return Path.GetFileName(FileName); } }

        public RenameScheme Scheme { get; set; }

        public bool MergeAssemble { get; set; }

        public bool EncryptString { get; set; }

        public bool HideExternalMethods { get; set; }

        public bool ClassDecomposition { get; set; }

        public bool LibraryMode { get; set; }

        public bool ControlFlow { get; set; }

        public AssemblyItem(string fullPath)
        {
            FileName = fullPath;
            Reset();
        }

        private void Reset()
        {
            Scheme = RenameScheme.LatinAlphabeticalOrder;

            MergeAssemble = false;
            EncryptString = UserTariff.Instance.EncodeStrings;
            HideExternalMethods = UserTariff.Instance.ExternalMethodCallHidding;
            ClassDecomposition = UserTariff.Instance.Decomposition;
            ControlFlow = UserTariff.Instance.ControlFlow;
            LibraryMode = false;
        }

        public override string ToString()
        {
            return Title;
        }
    }
}

